package com.liannong.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.ibatis.type.JdbcType;

import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("trace_codes")
public class TraceCode {

    @ApiModelProperty(value = "产品追溯码", required = true)
    @TableId(value = "trace_code", type = IdType.INPUT) // 非自增主键
    private String traceCode;

    @ApiModelProperty(value = "采收时间", example = "2023-11-15 14:30:00")
    @TableField("harvest_time")
    private LocalDateTime harvestTime;

    @ApiModelProperty(value = "原产地", example = "中国云南")
    @TableField(value = "origin", jdbcType = JdbcType.VARCHAR)
    private String origin;
}
